package han.fetch;

import han.proof.Cookie;
import han.proof.CookieRepository;

import static han.fetch.Login.login;

/**
 * @author: Han
 * @date: 2018/7/12 16:19
 * @dscription: TODO
 */
public class Main {

    public static void main(String... args) {
        Main main = new Main();
        main.run(3);
    }

    /**
     * 根据i值不同调用不同的方法,抓取不同的数据
     *
     * @param i 0:融资公司id
     *          1:融资项目信息
     *          2:投资公司id
     *          3:投资公司信息
     */
    private void run(int i) {
        Cookie[] webCookies = {
                new Cookie("1", ""),
                new Cookie("2", ""),
                new Cookie("3", ""),
                new Cookie("4", ""),
                new Cookie("5", ""),
                new Cookie("6", ""),
                new Cookie("7", ""),
                new Cookie("8", ""),
                new Cookie("9", ""),
                new Cookie("10", ""),
                new Cookie("11", ""),
                new Cookie("12", ""),
                new Cookie("13", ""),
                new Cookie("14", ""),
                new Cookie("15", ""),
                new Cookie("16", ""),
                new Cookie("17", ""),
                new Cookie("18", ""),
                new Cookie("19", ""),
                new Cookie("20", ""),
                new Cookie("21", ""),
                new Cookie("22", ""),
                new Cookie("23", ""),
                new Cookie("24", ""),
                new Cookie("25", ""),
                new Cookie("26", ""),
                new Cookie("27", ""),
                new Cookie("28", ""),
                new Cookie("29", ""),
                new Cookie("30", ""),
                new Cookie("31", ""),
                new Cookie("32", ""),
                new Cookie("33", ""),
                new Cookie("34", ""),
                new Cookie("35", ""),
                new Cookie("36", ""),
                new Cookie("37", ""),
                new Cookie("38", ""),
                new Cookie("39", ""),
                new Cookie("40", ""),
                new Cookie("41", ""),
                new Cookie("42", ""),
                new Cookie("43", ""),
                new Cookie("44", ""),
                new Cookie("45", ""),
                new Cookie("46", ""),
                new Cookie("47", ""),
                new Cookie("48", ""),
                new Cookie("49", ""),
                new Cookie("50", ""),
        };
        if (i == 0) {
            Cookie[] appCookies = {
                    login("18455123272", "123456"),
                    login("1083278145@qq.com", "123456"),
                    login("1601070649@qq.com", "123456"),
                    login("1732162843@qq.com", "123456"),
                    login("63683742@qq.com", "123456"),
                    login("761628360@qq.com", "761628360"),
                    login("1526395226@qq.com", "1526395226"),
                    login("18297983462", "123456BB"),
                    login("865599596@qq.com", "123456by"),
                    login("18788871767", "147852tmm"),
                    login("blue365rain@yeah.net", "blue365rain"),
                    login("2508566909@qq.com", "boryou"),
                    login("153354167@qq.com", "boyuekeji"),
                    login("1134987056@qq.com", "This's36ke"),
                    login("1762586908@qq.com", "This's36ke"),
                    login("2313357796@qq.com", "This's36ke"),
                    login("2521957520@qq.com", "This's36ke"),
                    login("2677133868@qq.com", "This's36ke"),
                    login("highperformance@foxmail.com", "This's36ke"),
                    login("jf.han@outlook.com", "This's36ke"),
                    login("1752321672@qq.com", "wyy123456"),
                    login("15067924622", "xgx197923"),
            };
            CookieRepository cookieRepository = new CookieRepository(appCookies);
            FinanceProjectId financeProjectId = new FinanceProjectId(cookieRepository);
            financeProjectId.threadStart();
        } else if (i == 1) {
            Cookie[] appCookies = {
                    login("18455123272", "123456"),
                    login("1083278145@qq.com", "123456"),
                    login("1601070649@qq.com", "123456"),
                    login("1732162843@qq.com", "123456"),
                    login("63683742@qq.com", "123456"),
                    login("761628360@qq.com", "761628360"),
                    login("1526395226@qq.com", "1526395226"),
                    login("18297983462", "123456BB"),
                    login("865599596@qq.com", "123456by"),
                    login("18788871767", "147852tmm"),
                    login("blue365rain@yeah.net", "blue365rain"),
                    login("2508566909@qq.com", "boryou"),
                    login("153354167@qq.com", "boyuekeji"),
                    login("1134987056@qq.com", "This's36ke"),
                    login("1762586908@qq.com", "This's36ke"),
                    login("2313357796@qq.com", "This's36ke"),
                    login("2521957520@qq.com", "This's36ke"),
                    login("2677133868@qq.com", "This's36ke"),
                    login("highperformance@foxmail.com", "This's36ke"),
                    login("jf.han@outlook.com", "This's36ke"),
                    login("1752321672@qq.com", "wyy123456"),
                    login("15067924622", "xgx197923"),
            };
            CookieRepository cookieRepository = new CookieRepository(appCookies);
            FinanceProjectInfo info = new FinanceProjectInfo(cookieRepository);
            info.threadStart();
        } else if (i == 2) {
            CookieRepository cookieRepository = new CookieRepository(webCookies);
            InvestOrganizationId investOrganizationId = new InvestOrganizationId(cookieRepository);
            investOrganizationId.threadStart();
        } else if (i == 3) {
            CookieRepository cookieRepository = new CookieRepository(webCookies);
            InvestOrganizationInfo investOrganizationInfo = new InvestOrganizationInfo(cookieRepository);
            investOrganizationInfo.threadStart();
        }
    }
}
